﻿@model PagedList.StaticPagedList<e_commerce.Models.OrderModel>
@using PagedList.Mvc;
@{
    ViewBag.Title = "已处理订单";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="message-wrap">
    <div class="admin-nav">
        <div class="nav-text">
            <span>
                @TempData["f-nav"] > @TempData["s-nav"]
            </span>
        </div>
    </div>
    <div class="message-wrap-tab">
        <div class="box">
            <div class="box-head">
                <div class="box-title">
                    <img src="~/Image/icon_order.png" />
                    <span>已处理订单</span>
                </div>
            </div>
            <div class="box-body">
                <div class="wrap-tab">
                    <table class="layui-table" lay-skin='row'>
                        <colgroup>
                            <col width="200">
                            <col width="60">
                            <col width="100">
                            <col width="300">
                            <col width="80">
                            <col width="100">
                        </colgroup>
                        <thead>
                            <tr>
                                <th>商品名</th>
                                <th>数量</th>
                                <th>单价</th>
                                <th>买家备注</th>
                                <th>总计金额</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
            {
                                <tr>
                                    <td>@item.GoodsName</td>
                                    <td>@item.Count</td>
                                    <td>￥@item.Price</td>
                                    <td>@item.ClientMark</td>
                                    <td>￥@item.TotalAmount</td>
                                    <td>
                                        <input type="hidden" value="@item.OrderId" name="OrderId" />
                                        <span>订单已处理</span>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="wrap-pages">
            @Html.PagedListPager(Model, page => Url.Action("DealOrder", new { page }))
        </div>
    </div>
</div>

@section Styles{
}

@section Scripts{
    <script src="~/JS/AllOrder.js"></script>
    <script type="text/x-jsrender" id="OrderListTemplate">
        {{for order}}
        <tr>
            <td>{{:GoodsName}}</td>
            <td>{{:Count}}</td>
            <td>￥{{:Price}}</td><!--  -->
            <td>{{:ClientMark}}</td>
            <td>￥{{:TotalAmount}}</td>
            <td>
                <input type="hidden" value="{{:OrderId}}" name="OrderId" />
                <a class="accept-order">接受</a>
                <a class="cancle-order">取消</a>
            </td>
        </tr>
        {{/for}}
    </script>

    <script type="text/x-jsrender" id="OrderTemplate">
        {{if HasPreviousPage}}
        <a href="#" onclick="getOrderByAjax(1);return false;">&lt;&lt;</a>
        <a href="#" onclick="getOrderByAjax({{:PageNumber - 1}});return false;">&lt; Prev</a>
        {{else}}
        &lt;&lt;&nbsp;&lt; Prev
        {{/if}}
        &nbsp;
        {{if HasNextPage}}
        <a href="#" onclick="getOrderByAjax({{:PageNumber + 1}});return false;">Next &gt;</a>
        <a href="#" onclick="getOrderByAjax({{:PageCount}});return false;">&gt;&gt;</a>
        {{else}}
        Next &gt;&nbsp;&gt;&gt;
        {{/if}}
    </script>
}